/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cmp.logging;

import java.util.logging.*;
import static java.util.logging.Level.*;

/**
 *
 * @author Trinova
 */
public class LoggerControl {

    private static Handler consoleHandler;
    private static Handler fileHandler;
    private static final String LOG_FILE_PATH = "derpshitlog.log";
    private static final Logger logger = Logger.getLogger(LoggerControl.class.getName());

    static{
        logger.addHandler(LoggerControl.getConsoleHandler());
    }
    
    public static Handler getConsoleHandler() {
        if (consoleHandler == null) {
            consoleHandler = new ConsoleHandler();
        }
        return consoleHandler;
    }

    public static Handler getFileHandler() {
        if (fileHandler == null) {
            try {
                fileHandler = new FileHandler(LOG_FILE_PATH);
            } catch (Exception e) {
                
            }
        }
        fileHandler.setLevel(SEVERE);
        return fileHandler;
    }

    private LoggerControl() {
    }
}
